package io.gitee.zhucan123.core.controller;

import com.niimbot.middlend.core.config.flyway.MigrationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: zhuCan
 * @date: 2020/2/22 12:05
 * @description:
 */
@RestController
@RequestMapping("/flyway")
public class FlywayController {

  @Autowired
  private MigrationService migrationService;

  @GetMapping("/repair")
  public void repair(){
    migrationService.repair();
  }

  @GetMapping("/migrate")
  public void migrate(){
    migrationService.migrate();
  }
}
